<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>《火灾预防与逃生自救》- 科普小站官方售卖</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#E63946',
                        secondary: '#FFB703',
                        accent: '#1D3557',
                        light: '#F1FAEE',
                    }
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .btn-primary {
                @apply bg-primary text-white px-6 py-3 rounded-lg font-medium hover:bg-primary/90 transition-all duration-300 transform hover:scale-105;
            }
            .feature-card {
                @apply bg-light rounded-lg p-4 border-l-4 border-primary;
            }
            .section-title {
                @apply text-2xl md:text-3xl font-bold mb-6 pb-2 border-b border-gray-200;
            }
            .animate-fade-in {
                animation: fadeIn 0.8s ease-in-out;
            }
            @keyframes fadeIn {
                from { opacity: 0; transform: translateY(10px); }
                to { opacity: 1; transform: translateY(0); }
            }
            .flame-animation {
                animation: flame 1.5s ease-in-out infinite;
            }
            @keyframes flame {
                0%, 100% { transform: scale(1); }
                50% { transform: scale(1.05) rotate(2deg); }
            }
        }
    </style>
</head>
<body class="bg-gray-50 font-sans text-gray-800">
<!-- 导航栏 -->
<header class="bg-white shadow-sm sticky top-0 z-50 transition-all duration-300" id="navbar">
    <div class="container mx-auto px-4">
        <div class="flex items-center justify-between h-16">
            <div class="flex items-center">
                <i class="fa fa-fire text-primary text-2xl"></i>
                <h1 class="text-xl font-bold ml-2">科普小站</h1>
            </div>

            <nav class="hidden md:flex items-center space-x-6">
                <a href="#" class="font-medium text-primary border-b-2 border-primary pb-1">首页</a>
                <a href="#details" class="font-medium hover:text-primary transition-colors">图书详情</a>
                <a href="#contents" class="font-medium hover:text-primary transition-colors">目录预览</a>
                <a href="#reviews" class="font-medium hover:text-primary transition-colors">读者评价</a>
            </nav>

            <div class="flex items-center">
                <button class="md:hidden text-gray-600 mr-4" id="menu-toggle">
                    <i class="fa fa-bars text-xl"></i>
                </button>
                <div class="hidden md:flex items-center">
                    <i class="fa fa-search text-gray-500 mr-6"></i>
                    <i class="fa fa-shopping-cart text-gray-500 relative">
                        <span id="cart-count" class="absolute -top-2 -right-2 bg-primary text-white text-xs w-5 h-5 flex items-center justify-center rounded-full">0</span>
                    </i>
                </div>
            </div>
        </div>
    </div>
</header>

<!-- 移动端菜单 -->
<div class="fixed inset-0 bg-white z-40 transform translate-x-full transition-transform duration-300 md:hidden" id="mobile-menu">
    <div class="p-4 border-b flex justify-between items-center">
        <h2 class="text-xl font-bold">菜单</h2>
        <button id="menu-close"><i class="fa fa-times"></i></button>
    </div>
    <div class="p-4 space-y-3">
        <a href="#" class="block py-2 text-primary font-medium">首页</a>
        <a href="#details" class="block py-2 hover:text-primary">图书详情</a>
        <a href="#contents" class="block py-2 hover:text-primary">目录预览</a>
        <a href="#reviews" class="block py-2 hover:text-primary">读者评价</a>
    </div>
</div>

<!-- 页面标题区 -->
<section class="bg-gradient-to-r from-primary to-accent text-white py-16 md:py-24">
    <div class="container mx-auto px-4">
        <div class="max-w-4xl mx-auto text-center">
                <span class="inline-block bg-white/20 backdrop-blur-sm text-white text-sm px-4 py-1 rounded-full mb-4">
                    公安部消防局 编著
                </span>
            <h1 class="text-4xl md:text-5xl lg:text-6xl font-bold mb-6 leading-tight">火灾预防与逃生自救</h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90 max-w-2xl mx-auto">
                系统介绍火灾预防知识、初期火灾扑救和火场逃生技巧，关键时刻能救命的实用指南
            </p>
            <div class="flex flex-col sm:flex-row justify-center gap-4">
                <button id="buy-now" class="btn-primary flex items-center justify-center">
                    <i class="fa fa-shopping-cart mr-2"></i> 立即购买
                </button>
                <button class="bg-white/20 backdrop-blur-sm text-white border border-white/30 px-6 py-3 rounded-lg font-medium hover:bg-white/30 transition-colors flex items-center justify-center">
                    <i class="fa fa-info-circle mr-2"></i> 了解更多
                </button>
            </div>
        </div>
    </div>
</section>

<!-- 主内容区 -->
<main class="container mx-auto px-4 py-12">
    <!-- 书籍展示 -->
    <section class="mb-16 animate-fade-in">
        <div class="bg-white rounded-xl shadow-lg overflow-hidden">
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5">
                <div class="lg:col-span-2 p-6 md:p-10 flex items-center justify-center bg-gray-50">
                    <img src="https://img1.doubanio.com/view/subject/s/public/s28036739.jpg" alt="《火灾预防与逃生自救》封面" class="max-h-96 object-cover rounded shadow-md transform rotate-[-2deg] hover:rotate-0 transition-transform duration-500" id="book-cover">
                </div>
                <div class="lg:col-span-3 p-6 md:p-10">
                    <div class="flex flex-wrap gap-2 mb-4">
                        <span class="bg-red-100 text-primary text-xs px-3 py-1 rounded-full">火灾防护</span>
                        <span class="bg-yellow-100 text-yellow-700 text-xs px-3 py-1 rounded-full">安全指南</span>
                        <span class="bg-green-100 text-green-700 text-xs px-3 py-1 rounded-full">必备手册</span>
                    </div>

                    <h2 class="text-3xl font-bold mb-2">火灾预防与逃生自救</h2>
                    <p class="text-gray-600 text-lg mb-6">公安部消防局 编著</p>

                    <div class="mb-8">
                        <div class="flex items-baseline mb-2">
                            <span class="text-primary font-bold text-4xl">¥28.00</span>
                            <span class="text-gray-400 line-through ml-3 text-lg">¥39.00</span>
                            <span class="ml-3 bg-red-100 text-red-600 text-sm px-2 py-1 rounded">28% 优惠</span>
                        </div>
                        <p class="text-gray-500 text-sm">出版社直发 | 满99元免运费 | 支持7天无理由退换</p>
                    </div>

                    <div class="mb-8">
                        <h3 class="font-bold text-lg mb-3">内容简介</h3>
                        <p class="text-gray-700 leading-relaxed mb-4">
                            《火灾预防与逃生自救》由公安部消防局组织消防领域专家编写，系统介绍了火灾的成因与危害、日常火灾预防措施、常见火灾的扑救方法、火场逃生技巧以及火灾后的应急处理等知识。
                        </p>
                        <p class="text-gray-700 leading-relaxed">
                            本书内容科学实用，图文并茂，通俗易懂，涵盖了家庭、学校、商场、办公楼等不同场所的火灾预防与应对方法，是全民消防安全教育的必备读物。
                        </p>
                    </div>

                    <div class="flex flex-wrap gap-4">
                        <button id="add-to-cart" class="btn-primary flex items-center">
                            <i class="fa fa-shopping-cart mr-2"></i> 加入购物车
                        </button>
                        <button class="border border-primary text-primary px-6 py-3 rounded-lg font-medium hover:bg-primary/5 transition-colors flex items-center">
                            <i class="fa fa-heart-o mr-2"></i> 收藏
                        </button>
                    </div>

                    <div class="mt-8 pt-6 border-t border-gray-100 flex flex-wrap gap-6">
                        <div>
                            <div class="text-sm text-gray-500 mb-1">浏览次数</div>
                            <div class="font-medium" id="view-count">0</div>
                        </div>
                        <div>
                            <div class="text-sm text-gray-500 mb-1">购买次数</div>
                            <div class="font-medium" id="purchase-count">0</div>
                        </div>
                        <div>
                            <div class="text-sm text-gray-500 mb-1">用户评分</div>
                            <div class="flex items-center">
                                <div class="flex text-yellow-400">
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                </div>
                                <span class="ml-2 text-gray-600">5.0 (512评价)</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 火灾知识卡片 -->
    <section class="mb-16 animate-fade-in" style="animation-delay: 0.1s">
        <div class="bg-gradient-to-r from-light to-white rounded-xl p-6 md:p-8 shadow-md">
            <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                <div class="flex flex-col items-center text-center">
                    <div class="w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mb-4">
                        <i class="fa fa-exclamation-circle text-2xl text-primary"></i>
                    </div>
                    <h3 class="text-lg font-bold mb-2">火灾无情</h3>
                    <p class="text-gray-700">火灾是最常见的安全事故之一，每分钟都可能造成无法挽回的损失，预防是关键</p>
                </div>
                <div class="flex flex-col items-center text-center">
                    <div class="w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mb-4">
                        <i class="fa fa-clock-o text-2xl text-primary"></i>
                    </div>
                    <h3 class="text-lg font-bold mb-2">黄金逃生时间</h3>
                    <p class="text-gray-700">建筑发生火灾后，黄金逃生时间通常只有3-5分钟，掌握正确逃生方法能挽救生命</p>
                </div>
                <div class="flex flex-col items-center text-center">
                    <div class="w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mb-4">
                        <i class="fa fa-graduation-cap text-2xl text-primary"></i>
                    </div>
                    <h3 class="text-lg font-bold mb-2">全民必修</h3>
                    <p class="text-gray-700">火灾预防与逃生知识是每个人的必修课，尤其适合家庭、学校和企事业单位学习</p>
                </div>
            </div>
        </div>
    </section>

    <!-- 图书详情 -->
    <section id="details" class="mb-16 animate-fade-in" style="animation-delay: 0.2s">
        <h3 class="section-title">图书详情</h3>

        <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
            <div class="bg-white rounded-xl shadow-md p-6">
                <h4 class="text-xl font-bold mb-4">基本信息</h4>
                <table class="w-full">
                    <tbody>
                    <tr class="border-b border-gray-100">
                        <td class="py-3 text-gray-500 w-1/3">书名</td>
                        <td class="py-3">火灾预防与逃生自救</td>
                    </tr>
                    <tr class="border-b border-gray-100">
                        <td class="py-3 text-gray-500">作者</td>
                        <td class="py-3">公安部消防局 编著</td>
                    </tr>
                    <tr class="border-b border-gray-100">
                        <td class="py-3 text-gray-500">出版社</td>
                        <td class="py-3">中国人民公安大学出版社</td>
                    </tr>
                    <tr class="border-b border-gray-100">
                        <td class="py-3 text-gray-500">出版日期</td>
                        <td class="py-3">2020-01</td>
                    </tr>
                    <tr class="border-b border-gray-100">
                        <td class="py-3 text-gray-500">页数</td>
                        <td class="py-3">184页</td>
                    </tr>
                    <tr class="border-b border-gray-100">
                        <td class="py-3 text-gray-500">开本</td>
                        <td class="py-3">32开</td>
                    </tr>
                    <tr>
                        <td class="py-3 text-gray-500">ISBN</td>
                        <td class="py-3">9787565337821</td>
                    </tr>
                    </tbody>
                </table>
            </div>

            <div>
                <h4 class="text-xl font-bold mb-4">本书特点</h4>
                <div class="space-y-4">
                    <div class="feature-card">
                        <h5 class="font-bold mb-1 flex items-center">
                            <i class="fa fa-check-circle text-primary mr-2"></i> 权威性高
                        </h5>
                        <p class="text-gray-700 text-sm">由公安部消防局组织编写，内容科学权威，符合国家最新消防安全标准</p>
                    </div>

                    <div class="feature-card">
                        <h5 class="font-bold mb-1 flex items-center">
                            <i class="fa fa-check-circle text-primary mr-2"></i> 实用性强
                        </h5>
                        <p class="text-gray-700 text-sm">提供具体可操作的预防和应对方法，步骤清晰，图文结合，易学易用</p>
                    </div>

                    <div class="feature-card">
                        <h5 class="font-bold mb-1 flex items-center">
                            <i class="fa fa-check-circle text-primary mr-2"></i> 场景全面
                        </h5>
                        <p class="text-gray-700 text-sm">涵盖家庭、学校、办公楼、商场等不同场所的火灾预防与逃生方法</p>
                    </div>

                    <div class="feature-card">
                        <h5 class="font-bold mb-1 flex items-center">
                            <i class="fa fa-check-circle text-primary mr-2"></i> 案例丰富
                        </h5>
                        <p class="text-gray-700 text-sm">包含大量真实案例分析，总结经验教训，提高读者应对能力</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 目录预览 -->
    <section id="contents" class="mb-16 animate-fade-in" style="animation-delay: 0.3s">
        <h3 class="section-title">目录预览</h3>

        <div class="bg-white rounded-xl shadow-md p-6 md:p-8">
            <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                <div>
                    <h4 class="text-lg font-bold mb-4 text-primary">第一章 火灾基本知识</h4>
                    <ul class="space-y-2 text-gray-700 ml-6 list-disc">
                        <li>1.1 火灾的成因与分类</li>
                        <li>1.2 火灾的发展阶段与特点</li>
                        <li>1.3 火灾的危害与常见误区</li>
                        <li>1.4 消防安全法律法规简介</li>
                        <li>1.5 常见消防设施及其作用</li>
                    </ul>

                    <h4 class="text-lg font-bold mb-4 mt-6 text-primary">第二章 火灾预防措施</h4>
                    <ul class="space-y-2 text-gray-700 ml-6 list-disc">
                        <li>2.1 家庭火灾预防要点</li>
                        <li>2.2 电气火灾的预防</li>
                        <li>2.3 厨房火灾的预防</li>
                        <li>2.4 吸烟引发火灾的预防</li>
                        <li>2.5 公共场所火灾预防措施</li>
                    </ul>

                    <h4 class="text-lg font-bold mb-4 mt-6 text-primary">第三章 初期火灾的扑救</h4>
                    <ul class="space-y-2 text-gray-700 ml-6 list-disc">
                        <li>3.1 火灾报警的正确方法</li>
                        <li>3.2 灭火器的选择与使用</li>
                        <li>3.3 常见火灾的扑救方法</li>
                        <li>3.4 扑救火灾的注意事项</li>
                        <li>3.5 无法控制火势时的应对</li>
                    </ul>
                </div>

                <div>
                    <h4 class="text-lg font-bold mb-4 text-primary">第四章 火场逃生技巧</h4>
                    <ul class="space-y-2 text-gray-700 ml-6 list-disc">
                        <li>4.1 制定家庭逃生计划</li>
                        <li>4.2 火场逃生的基本原则</li>
                        <li>4.3 不同场所的逃生方法</li>
                        <li>4.4 浓烟环境下的逃生技巧</li>
                        <li>4.5 被困时的自救方法</li>
                    </ul>

                    <h4 class="text-lg font-bold mb-4 mt-6 text-primary">第五章 特殊人群的逃生与救助</h4>
                    <ul class="space-y-2 text-gray-700 ml-6 list-disc">
                        <li>5.1 儿童的火灾逃生与保护</li>
                        <li>5.2 老年人的火灾逃生与救助</li>
                        <li>5.3 残疾人的火灾逃生与救助</li>
                        <li>5.4 高层建筑火灾的逃生要点</li>
                        <li>5.5 地下场所火灾的逃生要点</li>
                    </ul>

                    <h4 class="text-lg font-bold mb-4 mt-6 text-primary">第六章 火灾后的处理</h4>
                    <ul class="space-y-2 text-gray-700 ml-6 list-disc">
                        <li>6.1 火灾后的现场保护</li>
                        <li>6.2 火灾受伤人员的急救</li>
                        <li>6.3 火灾后的心理调适</li>
                        <li>6.4 火灾原因调查与责任认定</li>
                        <li>6.5 消防安全宣传与培训</li>
                    </ul>
                </div>
            </div>

            <div class="mt-8 text-center">
                <button class="text-primary hover:text-accent transition-colors font-medium flex items-center mx-auto">
                    <span>查看完整目录</span>
                    <i class="fa fa-angle-right ml-1"></i>
                </button>
            </div>
        </div>
    </section>

    <!-- 读者评价 -->
    <section id="reviews" class="mb-16 animate-fade-in" style="animation-delay: 0.4s">
        <h3 class="section-title">读者评价</h3>

        <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
            <div class="bg-white rounded-xl shadow-md p-6 transition-all duration-300 hover:shadow-lg">
                <div class="flex text-yellow-400 mb-3">
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                </div>
                <p class="text-gray-700 mb-4">
                    这本书真的救了我们全家！去年家中厨房突发小火，我按照书中的方法迅速扑灭，避免了一场大灾难。内容非常实用，每个家庭都应该备一本，特别是有老人和小孩的家庭。
                </p>
                <div class="flex items-center">
                    <img src="https://picsum.photos/seed/user7/100/100" alt="用户头像" class="w-10 h-10 rounded-full mr-3">
                    <div>
                        <h5 class="font-bold">陈女士</h5>
                        <p class="text-gray-500 text-sm">购买于 2023-06-18</p>
                    </div>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-md p-6 transition-all duration-300 hover:shadow-lg">
                <div class="flex text-yellow-400 mb-3">
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                </div>
                <p class="text-gray-700 mb-4">
                    作为学校安全负责人，我们为每个班级都配备了这本书。内容全面，操作性强，图文并茂，学生们很容易理解。书中的逃生演练方案也非常实用，强烈推荐给教育机构。
                </p>
                <div class="flex items-center">
                    <img src="https://picsum.photos/seed/user8/100/100" alt="用户头像" class="w-10 h-10 rounded-full mr-3">
                    <div>
                        <h5 class="font-bold">林老师</h5>
                        <p class="text-gray-500 text-sm">购买于 2023-05-22</p>
                    </div>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-md p-6 transition-all duration-300 hover:shadow-lg">
                <div class="flex text-yellow-400 mb-3">
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star"></i>
                    <i class="fa fa-star-half-o"></i>
                </div>
                <p class="text-gray-700 mb-4">
                    内容专业详实，从预防到逃生再到灾后处理都有详细介绍。特别喜欢书中关于不同场所逃生方法的部分，非常具体。作为企业安全培训教材非常合适，已经推荐给很多同行。
                </p>
                <div class="flex items-center">
                    <img src="https://picsum.photos/seed/user9/100/100" alt="用户头像" class="w-10 h-10 rounded-full mr-3">
                    <div>
                        <h5 class="font-bold">王先生</h5>
                        <p class="text-gray-500 text-sm">购买于 2023-04-15</p>
                    </div>
                </div>
            </div>
        </div>

        <div class="mt-8 text-center">
            <button class="border border-primary text-primary px-6 py-2 rounded-lg font-medium hover:bg-primary/5 transition-colors">
                查看全部512条评价
            </button>
        </div>
    </section>

    <!-- 相关推荐 -->
    <section class="animate-fade-in" style="animation-delay: 0.5s">
        <h3 class="section-title">相关推荐</h3>

        <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
            <!-- 相关书籍1 -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-lg hover:-translate-y-1 cursor-pointer">
                <div class="h-56 overflow-hidden">
                    <img src="https://img1.doubanio.com/view/subject/s/public/s28036742.jpg" alt="《防灾应急手册》封面" class="w-full h-full object-cover transition-transform duration-500 hover:scale-110">
                </div>
                <div class="p-4">
                    <h4 class="font-bold text-lg mb-1 line-clamp-1">防灾应急手册</h4>
                    <p class="text-gray-600 text-sm mb-2">国家减灾委员会办公室 编</p>
                    <div class="flex justify-between items-center">
                        <span class="text-primary font-bold">¥39.00</span>
                        <div class="flex text-yellow-400 text-xs">
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 相关书籍2 -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-lg hover:-translate-y-1 cursor-pointer">
                <div class="h-56 overflow-hidden">
                    <img src="https://img1.doubanio.com/view/subject/s/public/s29977400.jpg" alt="《地震应急避险指南》封面" class="w-full h-full object-cover transition-transform duration-500 hover:scale-110">
                </div>
                <div class="p-4">
                    <h4 class="font-bold text-lg mb-1 line-clamp-1">地震应急避险指南</h4>
                    <p class="text-gray-600 text-sm mb-2">中国地震局 编</p>
                    <div class="flex justify-between items-center">
                        <span class="text-primary font-bold">¥25.00</span>
                        <div class="flex text-yellow-400 text-xs">
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star-half-o"></i>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 相关书籍3 -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-lg hover:-translate-y-1 cursor-pointer">
                <div class="h-56 overflow-hidden">
                    <img src="https://img1.doubanio.com/view/subject/s/public/s29977402.jpg" alt="《急救手册》封面" class="w-full h-full object-cover transition-transform duration-500 hover:scale-110">
                </div>
                <div class="p-4">
                    <h4 class="font-bold text-lg mb-1 line-clamp-1">急救手册（第5版）</h4>
                    <p class="text-gray-600 text-sm mb-2">北京协和医院 编</p>
                    <div class="flex justify-between items-center">
                        <span class="text-primary font-bold">¥68.00</span>
                        <div class="flex text-yellow-400 text-xs">
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 相关书籍4 -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-lg hover:-translate-y-1 cursor-pointer">
                <div class="h-56 overflow-hidden">
                    <img src="https://img1.doubanio.com/view/subject/s/public/s28036741.jpg" alt="《家庭应急手册》封面" class="w-full h-full object-cover transition-transform duration-500 hover:scale-110">
                </div>
                <div class="p-4">
                    <h4 class="font-bold text-lg mb-1 line-clamp-1">家庭应急手册</h4>
                    <p class="text-gray-600 text-sm mb-2">中国标准化研究院 编</p>
                    <div class="flex justify-between items-center">
                        <span class="text-primary font-bold">¥35.00</span>
                        <div class="flex text-yellow-400 text-xs">
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star"></i>
                            <i class="fa fa-star-half-o"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</main>

<!-- 页脚 -->
<footer class="bg-accent text-white py-10 mt-10">
    <div class="container mx-auto px-4">
        <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
            <div>
                <div class="flex items-center space-x-2 mb-4">
                    <i class="fa fa-fire text-white text-2xl"></i>
                    <h2 class="text-xl font-bold">科普小站</h2>
                </div>
                <p class="text-gray-200 text-sm">
                    专注于普及科学知识，特别是防灾减灾和应急自救知识，提高全民安全意识和自救能力。
                </p>
            </div>

            <div>
                <h3 class="text-lg font-medium mb-4">快速链接</h3>
                <ul class="space-y-2 text-gray-200">
                    <li><a href="#" class="hover:text-white transition-colors">首页</a></li>
                    <li><a href="#details" class="hover:text-white transition-colors">图书详情</a></li>
                    <li><a href="#contents" class="hover:text-white transition-colors">目录预览</a></li>
                    <li><a href="#reviews" class="hover:text-white transition-colors">读者评价</a></li>
                </ul>
            </div>

            <div>
                <h3 class="text-lg font-medium mb-4">帮助中心</h3>
                <ul class="space-y-2 text-gray-200">
                    <li><a href="#" class="hover:text-white transition-colors">购物指南</a></li>
                    <li><a href="#" class="hover:text-white transition-colors">支付方式</a></li>
                    <li><a href="#" class="hover:text-white transition-colors">配送说明</a></li>
                    <li><a href="#" class="hover:text-white transition-colors">退换政策</a></li>
                </ul>
            </div>

            <div>
                <h3 class="text-lg font-medium mb-4">联系我们</h3>
                <ul class="space-y-2 text-gray-200">
                    <li class="flex items-center">
                        <i class="fa fa-phone mr-2"></i>
                        <span>400-123-4567</span>
                    </li>
                    <li class="flex items-center">
                        <i class="fa fa-envelope mr-2"></i>
                        <span>service@kepuxiaozhan.com</span>
                    </li>
                    <li class="flex items-center">
                        <i class="fa fa-map-marker mr-2"></i>
                        <span>北京市海淀区科学馆路100号</span>
                    </li>
                </ul>
            </div>
        </div>

        <div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-300 text-sm">
            <p>&copy; 2025 科普小站 版权所有 | 普及科学知识 · 守护生命安全</p>
        </div>
    </div>
</footer>

<!-- 购买成功提示 -->
<div id="toast" class="fixed top-6 right-6 bg-green-500 text-white px-6 py-3 rounded-lg shadow-lg transform translate-x-full transition-transform duration-300 flex items-center z-50">
    <i class="fa fa-check-circle mr-2"></i>
    <span>《火灾预防与逃生自救》已加入购物车</span>
</div>

<!-- 回到顶部按钮 -->
<button id="back-to-top" class="fixed bottom-6 right-6 bg-primary text-white w-12 h-12 rounded-full flex items-center justify-center shadow-lg opacity-0 invisible transition-all duration-300 hover:bg-primary/90">
    <i class="fa fa-arrow-up"></i>
</button>

<script>
    // 初始化页面
    document.addEventListener('DOMContentLoaded', function() {
        // 初始化计数器
        initCounters();

        // 初始化回到顶部按钮
        initBackToTopButton();

        // 初始化移动端菜单
        initMobileMenu();

        // 初始化平滑滚动
        initSmoothScroll();

        // 初始化导航栏滚动效果
        initNavbarScroll();

        // 绑定购买按钮事件
        document.getElementById('add-to-cart').addEventListener('click', addToCart);
        document.getElementById('buy-now').addEventListener('click', addToCart);

        // 书籍封面悬停动画效果
        document.getElementById('book-cover').addEventListener('mouseenter', function() {
            this.classList.add('flame-animation');
        });

        document.getElementById('book-cover').addEventListener('mouseleave', function() {
            this.classList.remove('flame-animation');
        });

        // 增加浏览计数
        incrementViewCount();
    });

    // 初始化计数器
    function initCounters() {
        // 从本地存储获取计数数据，默认为0
        const counts = JSON.parse(localStorage.getItem('fireGuideCounts')) || {
            view: 0,
            purchase: 0,
            cart: 0
        };

        // 更新页面显示
        document.getElementById('view-count').textContent = counts.view;
        document.getElementById('purchase-count').textContent = counts.purchase;
        document.getElementById('cart-count').textContent = counts.cart;
    }

    // 增加浏览计数
    function incrementViewCount() {
        // 获取当前计数
        const counts = JSON.parse(localStorage.getItem('fireGuideCounts')) || {
            view: 0,
            purchase: 0,
            cart: 0
        };

        // 增加浏览计数
        counts.view++;

        // 更新页面显示
        document.getElementById('view-count').textContent = counts.view;

        // 保存更新后的计数
        localStorage.setItem('fireGuideCounts', JSON.stringify(counts));
    }

    // 加入购物车
    function addToCart() {
        // 获取当前计数
        const counts = JSON.parse(localStorage.getItem('fireGuideCounts')) || {
            view: 0,
            purchase: 0,
            cart: 0
        };

        // 增加购买计数和购物车计数
        counts.purchase++;
        counts.cart++;

        // 更新页面显示
        document.getElementById('purchase-count').textContent = counts.purchase;
        document.getElementById('cart-count').textContent = counts.cart;

        // 保存更新后的计数
        localStorage.setItem('fireGuideCounts', JSON.stringify(counts));

        // 显示提示
        const toast = document.getElementById('toast');
        toast.classList.remove('translate-x-full');

        // 3秒后隐藏提示
        setTimeout(() => {
            toast.classList.add('translate-x-full');
        }, 3000);
    }

    // 回到顶部按钮
    function initBackToTopButton() {
        const backToTopButton = document.getElementById('back-to-top');

        window.addEventListener('scroll', function() {
            if (window.pageYOffset > 300) {
                backToTopButton.classList.remove('opacity-0', 'invisible');
                backToTopButton.classList.add('opacity-100', 'visible');
            } else {
                backToTopButton.classList.add('opacity-0', 'invisible');
                backToTopButton.classList.remove('opacity-100', 'visible');
            }
        });

        backToTopButton.addEventListener('click', function() {
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
        });
    }

    // 移动端菜单
    function initMobileMenu() {
        const menuToggle = document.getElementById('menu-toggle');
        const menuClose = document.getElementById('menu-close');
        const mobileMenu = document.getElementById('mobile-menu');

        menuToggle.addEventListener('click', function() {
            mobileMenu.classList.remove('translate-x-full');
        });

        menuClose.addEventListener('click', function() {
            mobileMenu.classList.add('translate-x-full');
        });
    }

    // 平滑滚动
    function initSmoothScroll() {
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function(e) {
                e.preventDefault();

                const targetId = this.getAttribute('href');
                if (targetId === '#') return;

                const targetElement = document.querySelector(targetId);
                if (targetElement) {
                    window.scrollTo({
                        top: targetElement.offsetTop - 80,
                        behavior: 'smooth'
                    });

                    // 关闭移动端菜单
                    const mobileMenu = document.getElementById('mobile-menu');
                    if (!mobileMenu.classList.contains('translate-x-full')) {
                        mobileMenu.classList.add('translate-x-full');
                    }
                }
            });
        });
    }

    // 导航栏滚动效果
    function initNavbarScroll() {
        const navbar = document.getElementById('navbar');

        window.addEventListener('scroll', function() {
            if (window.pageYOffset > 100) {
                navbar.classList.add('shadow-md');
                navbar.classList.remove('shadow-sm');
            } else {
                navbar.classList.remove('shadow-md');
                navbar.classList.add('shadow-sm');
            }
        });
    }
</script>
</body>
</html>
